var roleManage = function() {

    var _init = function() {

        $("#jqGrid").jqGrid({
            url: '../filemanagement/list',
            datatype: "json",
            colModel: [
                { label: 'id', name: 'id', index: 'id', width: 50, key: true,hidden:true },
                { label: '文件名', name: 'fileName', index: 'file_name', width: 80 },
                { label: 'URL地址', name: 'url',width: 160 },
                { label: '上传时间', name: 'uploadTime', index: 'uploadTime', width: 80 },
                { label: '操作', width: 40}
            ],
            viewrecords: true,
            height: 385,
            rowNum: 10,
            rowList : [10,30,50],
            rownumbers: true,
            rownumWidth: 25,
            autowidth:true,
            multiselect: true,
            pager: "#jqGridPager",
            jsonReader : {
                root: "page.list",
                page: "page.currPage",
                total: "page.totalPage",
                records: "page.totalCount"
            },
            prmNames : {
                page:"page",
                rows:"limit",
                order: "order"
            },
            gridComplete:function(){
                //隐藏grid底部滚动条
                $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
            }
        });

    }

    return {
        init: function() {
            _init();
        }

    };

}();

$(function() {
    roleManage.init();
});